<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <meta http-equiv="X-UA-Compatible" content="ie=edge" />
        <title>新闻列表案例</title>
        <link rel="stylesheet" href="./assets/news.css" />
        <script src="./lib/jquery.js"></script>
        <script src="./lib/template-web.js"></script>
        <script src="./js/index.js"></script>
    </head>
    <body>
        <div id="news-list">
        </div>


        <!-- TODU： 模板引擎定义在这里 -->        
        <script type="text/html" id="tpl">
            {{each data}}           
            <div class="news-item">
                <img class="thumb" src="{{'http://www.liulongbin.top:3006' + $value.img}}" alt="" />
                <div class="right-box">
                    <h1 class="title">{{$value.title}}</h1>
                    <div class="tags">
                        {{each $value.tags}}
                        <span>{{$value}}</span>
                        {{/each}}
                    </div>
                    <div class="footer">
                        <div>
                            <span>{{$value.source}}</span>
                            &nbsp;&nbsp;
                            <span>{{$value.time | getData}}</span>
                        </div>
                        <span>评论数：{{$value.cmtcount}}</span>
                    </div>
                </div>               
            </div>
            {{/each}}
        </script>
    </body>
</html>
